import cookies from './cookies'
import db from './db'

function recursion(data) {
  data.forEach(v => {
    if (v.waringTypePoList.length != 0) {
      v.selectable = false;
      recursion(v.waringTypePoList)
    }
  })
  return data
}
const util = {
  cookies,
  db,
  recursion
}

/**
 * @description 更新标题
 * @param {String} title 标题
 */
util.title = function (titleText) {
  const processTitle = process.env.VUE_APP_TITLE || ''
  window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}`
}

export default util
